<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>字典添加</title>
	<script>document.write('<script src="../../plugin/vue/js/import.js?' + Math.random() + '"><' + '/script>');</script>
    <script>_import("../../plugin/vue/js/before.js");</script>
   	<script>_import("../../plugin/webuploader/webuploader.js");</script>
	<link rel="stylesheet" type="text/css" href="../../plugin/webuploader/webuploader.css"/>
	<style type="text/css">
		.dict-form input[type=text]{ width: 320px; }
	</style>
</head>
<body>
<div id="app" class="container" v-cloak>
	<div class="panel panel-default">
       <div class="panel-heading">
           <h3 class="panel-title"><i class="el-icon-document mr5"></i>{{title}}</h3>
       </div>
    <div class="panel-body">
		<!-- <h4 class="mt-10">字典定义</h4>  -->
	    <el-form :inline="true" label-width="120px"
	        label-width="121px" class="dict-form"> 
	      <el-form-item label="字典编码：">
	         <el-input v-model="code"></el-input>
	      </el-form-item>
	      <el-form-item label="字典名称：">
	      	 <el-input v-model="code_desc"></el-input>
	      </el-form-item>
	      <div>
	        <el-form-item label="显示顺序：" class="c-kp-dlselect">
	           <el-input-number v-model="display_order" controls-position="right" :min="0"></el-input-number>
	         </el-form-item>
	        <el-form-item label="备注：">
	           <el-input v-model="rmk"></el-input>
	        </el-form-item>
	      </div>
	      <div>
	      	<el-form-item label="Logo：" class="c-kp-dlselect">
	      	   <img id="dict_logo" @click="upLogo(-1)" title="点击上传" :onerror="err_vlogo" :src="dict_logo" style="width:50px;height:50px;cursor:pointer;"/>
	         </el-form-item>
	      </div>
	    </el-form>
	    <div id="picker" style="display:none;">点击上传</div>
	    <div style="position:relative">
	       <!--  <h4>字典内容</h4> -->
           <el-button type="primary" @click="addRow();" style="position: absolute; right: 10px; top:10px;">增加字典</el-button>
        </div>

        <div style="max-height: 220px; overflow: auto; margin-top:50px;">
	        <el-table :data="dictData" border style="width: 100%;" class="w-tablesub">
	        	<el-table-column label="字典编码">
	        		<template slot-scope="scope">
	        			<el-input v-model="scope.row.code"></el-input>
	        		</template>
	        	</el-table-column>
	        	<el-table-column label="字典名称">
	        		<template slot-scope="scope">
	        			<div style="float: left; width: 110px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
 						 margin-top: 5px; line-height:20px;">{{scope.row.code_desc}}</div>
	        			<el-popover placement="right" width="300" trigger="click">
		           		  <el-input type="textarea" :rows="6" v-model="scope.row.code_desc"></el-input>
		            	  <i style="position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border: solid 1px #888;
  							 border-radius: 50%; cursor: pointer;" class="el-icon-close" @click="closePopup"></i>
		           	      <el-button slot="reference" title="编辑" size="mini"><i class="el-icon-edit" ref="btn"></i></el-button>
		            	</el-popover>
	        		</template>
	        	</el-table-column>
	        	<el-table-column label="显示顺序">
	        		<template slot-scope="scope">
	        			<el-input-number v-model="scope.row.display_order" controls-position="right" :min="0">
	        			</el-input-number>
	        		</template>
	        	</el-table-column>
	        	<el-table-column label="备注">
	        		<template slot-scope="scope">
	        			<div style="float: left; width: 110px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
 						 margin-top: 5px; line-height:20px;">{{scope.row.remarks}}</div>
	        			<el-popover placement="right" width="300" trigger="click">
		           		  <el-input type="textarea" :rows="6" v-model="scope.row.remarks"></el-input>
		            	  <i style="position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border: solid 1px #888;
  							 border-radius: 50%; cursor: pointer;" class="el-icon-close" @click="closePopup"></i>
		           	      <el-button slot="reference" title="编辑" size="mini"><i class="el-icon-edit" ref="btn"></i></el-button>
		            	</el-popover>
	        		</template>
	        	</el-table-column>
	        	<el-table-column label="Logo">
	        		<template slot-scope="scope">
	        			<img class="logos" @click="upLogo(scope.row.idx)" :src="scope.row.dict_logo" :onerror="err_vlogo" title="点击上传" style="width:30px;height:30px; cursor:pointer;"/>
	        			<!-- 
	        			<el-input v-model="scope.row.dict_logo"></el-input>
	        			 -->
	        		</template>
	        	</el-table-column>
	        	<el-table-column label="操作">
	                <template slot-scope="scope">
	                  	<i class="el-icon-delete" title="删除" @click="delDict(scope.row)" style="cursor:pointer;"></i>
	                </template>
	            </el-table-column> 
	        </el-table>
        </div>
        
	    <div slot="footer" style="margin-top: 20px; text-align:center;">
            <el-button type="primary" @click="save">保 存</el-button>
            <el-button @click="back">关 闭</el-button>
        </div>
	</div>
</div>
<script>
    _import("../../plugin/vue/js/after.js");
</script> 
<script>
    _import("js/dictadd.js");
</script>
</body>
</html>